﻿namespace Wechatbot.Model
{
    public class WechatMessageModel
    {
        /// <summary>
        /// 功能类型：✅ 文字(text) ✅ 链接卡片(urlLink) ✅ 图片(file) ✅ 视频(file) ✅ 附件(file) ✅ 语音(file) ✅ 添加好友邀请(friendship)
        /// 其他类型：未实现的消息类型(unknown)
        /// 系统类型：✅ 登录(system_event_login) ✅ 登出(system_event_logout) ✅ 异常报错(system_event_error) ✅ 快捷回复后消息推送状态通知(system_event_push_notify)
        /// </summary>
        public string Type { get; set; } = "text";

        /// <summary>
        /// 传输的内容, 文本或传输的文件共用这个字段
        /// </summary>
        public string? Content { get; set; }

        /// <summary>
        /// 消息的相关发送方数据, JSON String
        /// </summary>
        public string Source { get; set; }

        /// <summary>
        /// 该消息是@我的消息 否0 是1
        /// </summary>
        public string? IsMentioned { get; set; }

        /// <summary>
        /// 是否是来自自己的消息 否0 是1
        /// </summary>
        public string? IsMsgFromSelf { get; set; }
    }

    public class SourceFrom
    {
        public SourcePayload? from { get; set; }
    }

    public class SourcePayload
    {
        public string? id { get; set; }

        public SourceMessage? payload { get; set; }
        
    }

    public class SourceMessage
    {
        /// <summary>
        /// 地址
        /// </summary>
        public string? address { get; set; }

        /// <summary>
        /// 别名
        /// </summary>
        public string? alias { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        public string? avatar { get; set; }

        /// <summary>
        /// 城市
        /// </summary>
        public string? city { get; set; }

        /// <summary>
        /// 朋友
        /// </summary>
        public bool friend { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public int gander { get; set; }

        public string? id { get; set; }

        /// <summary>
        /// 名字
        /// </summary>
        public string? name { get; set; }

        /// <summary>
        /// 省
        /// </summary>
        public string? province { get; set; }
    }
}
